<template>
   <el-table
        ref="multipleTable"
        :data="arr"
        style="width: 100%"
        >
        <el-table-column
        type="selection"
        width="55">
        </el-table-column>
        <el-table-column
         label="用户ID"
        prop="id"
        width="100"
        >
        </el-table-column>
        <el-table-column
        label="微信昵称"
        prop="name"
        width="120">
        </el-table-column>
        <el-table-column
        prop="cell"
        label="会员手机"
        width="110">
        </el-table-column>
        <el-table-column
        prop="date"
        label="消费金额"
        width="100">
        </el-table-column>
        <el-table-column
        label="订单数量"
        prop="dates"
        width="100">
        <template ></template>
        </el-table-column>
        <el-table-column
        label="会员等级"
        width="100"
        prop="income">
        </el-table-column>
        <el-table-column
        label="上次消费"
        width="160"
        prop="pay">
        </el-table-column>
        <el-table-column
        label="禁用账户"
        width="100"
         prop="money">
         <template slot-scope="scope">
         <el-switch
            v-model="scope.row.value"
            active-color="#ff4949"
            inactive-color="#909399">
            
            </el-switch>
         </template>
        </el-table-column>
        <el-table-column label="操作" width="260">
            <template slot-scope="scope">
                <el-button
                size="mini"
                type="warning"
                @click="handleEdit(scope.row)"
               >编辑</el-button>
                <el-button
                size="mini"
                type="danger"
                @click="handleDelete(scope.row.id)"

                >删除</el-button>
            </template>
        </el-table-column>
    </el-table>
</template>

<script>
import {deleteById} from '../../../api/Student'
export default {
    props:['arr'],
    data(){
        return{
            // tableData: [{
            // id:"0012639",
            // name: '王小虎',
            // cell: '1231456345',
            // date: '¥2314.00',
            // dates:10, 
            // income:3,
            // pay:"2022-01-01 10:55",
            
            
            // }],
            value:false
         }
    },
    methods:{
        handleEdit(row){
            console.log(row)
            this.$emit('openDiale',row)
        },
        handleDelete(id){
            console.log(id)
            deleteById({id:id}).then(res=>{
                console.log(res);
                if(res.code==200){
                    this.$emit('shuayin')
                }
            })
        }
    }
}
</script>

<style lang='less' scope>
.cell {
    text-align: center;
}.el-table th.el-table__cell{
    font-weight: 600;
    font-size: 16px;
    color: #333;
    background: #eef1f5;
  
}
</style>